home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20021006-20030409 / 000306_jaltman@watsun.cc.columbia.edu_Fri Feb 14 10:01:02 EST 2003.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  74 lines

  1. Article: 14102 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!jaltman
  3. From: jaltman@watsun.cc.columbia.edu (Jeffrey Altman)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Dealing with '\' char in strings of file locations
  6. Date: 14 Feb 2003 05:58:53 GMT
  7. Organization: Columbia University
  8. Lines: 57
  9. Message-ID: <b2i0it$lfs$1@newsmaster.cc.columbia.edu>
  10. References: <a70f50e.0302121525.7922c8c3@posting.google.com> <a70f50e.0302131451.4fe831f@posting.google.com> <b2h8jd$dp7$1@watsol.cc.columbia.edu>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1045202333 22012 128.59.39.2 (14 Feb 2003 05:58:53 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 14 Feb 2003 05:58:53 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14102
  16.  
  17. Just FYI:
  18.  
  19. The hostname portion of the UNC path must use backslashes.  They cannot be 
  20. replaced with forward slashes.  When command quoting is ON, you must 
  21. represent it as
  22.  
  23.   \\\\hostname\\dir\\subdir\\file.txt
  24.  
  25. or 
  26.  
  27.   \\\\hostname\\dir/subdir/file.txt
  28.  
  29.  
  30.  
  31. In article <b2h8jd$dp7$1@watsol.cc.columbia.edu>,
  32. Frank da Cruz <fdc@columbia.edu> wrote:
  33. : In article <a70f50e.0302131451.4fe831f@posting.google.com>,
  34. : Wes <wesdog@hotmail.com> wrote:
  35. : : I have learned alot since my last post...  I believe I understand the
  36. : : difference between ASSIGN, EVALUATE and DEFINE.
  37. : : 
  38. : : However I am still having trouble getting my mind around parsing UNC
  39. : : paths.  I have a UNC path "\\myserver\dir\subdir\file.txt" in the same
  40. : : location of each line (char 50 through 300 is reserved for the UNC,
  41. : : whitespace fills in what isnt used).
  42. : : 
  43. : Let's assume the UNC is stored in a macro (variable) called line, and
  44. : that it's left-adjusted in columns 50-300, right-padded by spaces.
  45. :   assign unc \ftrim(\fsubstr(\m(line),50,250))
  46. : This extracts the UNC and trims trailing blanks.  Now we can change those
  47. : pesky backslashes into harmless "forward" slashes:
  48. :   assign unc \freplace(\m(unc),\\,/)
  49. : Now the \m(unc) value is:
  50. :   //myserver/dir/subdir/file.txt
  51. : Of course all this could be combined into one statement:
  52. :   assign unc \ftrim(\fsubstr(\freplace(\m(line),\\,/),50,250))
  53. : Now to whack off the unwanted parts, you can use:
  54. :   void \fsplit(\m(unc),&a,/)
  55. :   asg \%n \fdim(&a)
  56. :   asg path \&a[\%n-1]/\&a[\%n]
  57. : - Frank
  58.  
  59.  
  60.  Jeffrey Altman * Volunteer Developer      Kermit 95 2.1 GUI available now!!!
  61.  The Kermit Project @ Columbia University  SSH, Secure Telnet, Secure FTP, HTTP
  62.  http://www.kermit-project.org/            Secured with MIT Kerberos, SRP, and 
  63.  kermit-support@columbia.edu               OpenSSL.
  64.